home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(load){
- if(_name != "trainengine")
- {
- direction = random(2);
- if(direction == 0)
- {
- placex = -200 + random(200);
- placey = -60;
- _X = placex;
- _Y = placey;
- maketrain = random(3);
- t = 950;
- while(maketrain + 951 >= t)
- {
- placex -= 20;
- duplicateMovieClip(_root.traincar,"train" + t,16384 + t);
- setProperty("_root.train" + t, _X, placex);
- setProperty("_root.train" + t, _Y, placey);
- tellTarget("_root.train" + t)
- {
- direction = 0;
- _rotation = 0;
- }
- t++;
- }
- _root.track._y = placey;
- _root.track._x = -20;
- }
- else
- {
- placex = 300 + random(200);
- placey = -60;
- _X = placex;
- _Y = placey;
- _rotation = 180;
- maketrain = random(3);
- t = 950;
- while(maketrain + 951 >= t)
- {
- placex += 20;
- duplicateMovieClip(_root.traincar,"train" + t,16384 + t);
- setProperty("_root.train" + t, _X, placex);
- setProperty("_root.train" + t, _Y, placey);
- tellTarget("_root.train" + t)
- {
- direction = 1;
- _rotation = 180;
- }
- t++;
- }
- _root.track._y = placey;
- _root.track._x = -20;
- }
- }
- }
-